Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngMock/$httpBackend): fail if a url is provided but is undefined #12777

Merged

Conversation

petebacondarwin
Copy link
Contributor

While the url parameter is optional for $httpBackend.when,
$httpBackend.expect and related shortcut methods, it should not have the
value of undefined if it has been provided.

This change ensures that an error is thrown in those cases.

Closes #8442
Closes #8462
Closes #10934

BREAKING CHANGE

It is no longer valid to explicitly pass undefined as the url argument
to any of the $httpBackend.when...() and $httpBackend.expect...()
methods.

While this argument is optional, it must have a defined value if it is
provided.

Previously passing an explicit undefined value was ignored but this
lead to invalid tests passing unexpectedly.

@Narretz
Copy link
Contributor

Narretz commented Jun 11, 2016

This needs a rebase but otherwise looks good.

@petebacondarwin petebacondarwin self-assigned this Jun 12, 2016
While the `url` parameter is optional for `$httpBackend.when`,
`$httpBackend.expect` and related shortcut methods, it should not have the
value of `undefined` if it has been provided.

This change ensures that an error is thrown in those cases.

Closes angular#8442
Closes angular#8462
Closes angular#10934
Closes angular#12777

BREAKING CHANGE

It is no longer valid to explicitly pass `undefined` as the `url` argument
to any of the `$httpBackend.when...()` and `$httpBackend.expect...()`
methods.

While this argument is optional, it must have a defined value if it is
provided.

Previously passing an explicit `undefined` value was ignored but this
lead to invalid tests passing unexpectedly.
@petebacondarwin petebacondarwin force-pushed the ngMock-httpBackend-assertions branch 2 times, most recently from 836cc0a to 7551b89 Compare June 12, 2016 19:24
@petebacondarwin petebacondarwin merged commit 7551b89 into angular:master Jun 12, 2016
@petebacondarwin petebacondarwin deleted the ngMock-httpBackend-assertions branch November 24, 2016 09:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants